AUTOMAKE_OPTIONS=gnu

lib_LTLIBRARIES = libfastbit.la
libfastbit_la_SOURCES = part.cpp bordm.cpp bord.cpp ibin.cpp column.cpp index.cpp \
 array_t.cpp parth3dw.cpp parth3da.cpp parth3db.cpp parth2d.cpp parth3d.cpp \
 meshQuery.cpp query.cpp colValues.cpp bitvector.cpp islice.cpp \
 ixambit.cpp parth.cpp mensa.cpp tafel.cpp party.cpp qExpr.cpp utilidor.cpp \
 bitvector64.cpp irange.cpp category.cpp iroster.cpp irelic.cpp ixpack.cpp \
 fileManager.cpp filter.cpp bundle.cpp capi.cpp ixbylt.cpp ixpale.cpp util.cpp \
 ixzone.cpp ixfuge.cpp ixfuzz.cpp isbiad.cpp icegale.cpp ifade.cpp \
 ixzona.cpp parti.cpp idirekte.cpp blob.cpp jnatural.cpp iskive.cpp isapid.cpp \
 idbak2.cpp jrange.cpp icentre.cpp quaere.cpp countQuery.cpp imesa.cpp \
 ikeywords.cpp selectClause.cpp dictionary.cpp whereClause.cpp idbak.cpp \
 icmoins.cpp resource.cpp fromClause.cpp rids.cpp fromLexer.cc whereParser.cc \
 selectLexer.cc whereLexer.cc fromParser.cc selectParser.cc
libfastbit_la_LDFLAGS = -version-info $(LIB_VERSION_INFO)

include_HEADERS = array_t.h bitvector.h bitvector64.h blob.h bord.h bundle.h capi.h category.h colValues.h column.h const.h countQuery.h dictionary.h fileManager.h horometer.h ibin.h ibis.h idirekte.h ikeywords.h index.h irelic.h iroster.h quaere.h mensa.h meshQuery.h part.h filter.h jnatural.h jrange.h whereClause.h whereLexer.h whereParser.hh qExpr.h query.h resource.h rids.h tab.h table.h tafel.h twister.h util.h utilidor.h location.hh position.hh stack.hh selectClause.h selectLexer.h selectParser.hh fromClause.h fromLexer.h fromParser.hh fastbit-config.h

EXTRA_DIST=whereLexer.ll whereParser.yy selectLexer.ll selectParser.yy fromLexer.ll fromParser.yy Doxyfile

# use a useless print statement to prevent the use of implicit rule
# to generating executable named predicate
parsers: whereLexer.cc whereParser.cc selectLexer.cc selectParser.cc fromLexer.cc fromParser.cc
	@echo Updated $@

docs: Doxyfile
	perl -pi -e 's/(PROJECT_NUMBER\s*=\s*).+/\1$(PACKAGE_VERSION)/' Doxyfile
	doxygen

# override the default rule generated by automake to make sure the prefix is changed
fastbit-config.h: stamp-h1
	@if test ! -f $@; then rm -f stamp-h1; else :; fi
	@if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) stamp-h1; else :; fi
	@if [ "`fgrep ' PACKAGE_' fastbit-config.h | wc -l`" -gt 0 ]; then \
	mv fastbit-config.h fastbit-config.bak; \
	sed -e 's/ PACKAGE_/ FASTBIT_/' fastbit-config.bak > fastbit-config.h; \
	if test ! fastbit-config.h -nt stamp-h1; then sleep 1; touch fastbit-config.h; else :; fi \
	fi

if MAINTAINER_MODE
# # rules to generate .hh and .cc files from lex/yacc files
location.hh position.hh stack.hh: whereParser.hh
whereParser.cc: whereParser.hh
	touch whereParser.cc
whereParser.hh: whereParser.yy
	bison -d -o whereParser.cc whereParser.yy
whereLexer.cc: whereLexer.ll whereParser.hh
	flex -o whereLexer.cc whereLexer.ll
selectParser.cc: selectParser.hh
	touch selectParser.cc
selectParser.hh: selectParser.yy
	bison -d -o selectParser.cc selectParser.yy
selectLexer.cc: selectLexer.ll selectParser.hh
	flex -o selectLexer.cc selectLexer.ll
fromParser.cc: fromParser.hh
	touch fromParser.cc
fromParser.hh: fromParser.yy
	bison -d -o fromParser.cc fromParser.yy
fromLexer.cc: fromLexer.ll fromParser.hh
	flex -o fromLexer.cc fromLexer.ll
endif

# targets that are not files
.PHONY: docs
